<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="API docs for the TinderSwapCard constructor from the Class TinderSwapCard class from the flutter_tindercard library, for the Dart programming language.">
  <title>TinderSwapCard constructor - TinderSwapCard class - flutter_tindercard library - Dart API</title>
  <!-- required because all the links are pseudo-absolute -->
  <base href="../..">

  <link href="https://fonts.googleapis.com/css?family=Source+Code+Pro:500,400i,400,300|Source+Sans+Pro:400,300,700" rel="stylesheet">
  <link rel="stylesheet" href="static-assets/github.css">
  <link rel="stylesheet" href="static-assets/styles.css">
  <link rel="icon" href="static-assets/favicon.png">

</head>

<body>

<div id="overlay-under-drawer"></div>

<header id="title">
  <button id="sidenav-left-toggle" type="button">&nbsp;</button>
  <ol class="breadcrumbs gt-separated dark hidden-xs">
    <li><a href="index.html">flutter_tindercard</a></li>
    <li><a href="flutter_tindercard/flutter_tindercard-library.html">flutter_tindercard</a></li>
    <li><a href="flutter_tindercard/TinderSwapCard-class.html">TinderSwapCard</a></li>
    <li class="self-crumb">TinderSwapCard constructor</li>
  </ol>
  <div class="self-name">TinderSwapCard</div>
  <form class="search navbar-right" role="search">
    <input type="text" id="search-box" autocomplete="off" disabled class="form-control typeahead" placeholder="Loading search...">
  </form>
</header>

<main>

  <div class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left">
    <h5>TinderSwapCard class</h5>
    <ol>
      <li class="section-title"><a href="flutter_tindercard/TinderSwapCard-class.html#constructors">Constructors</a></li>
      <li><a href="flutter_tindercard/TinderSwapCard/TinderSwapCard.html">TinderSwapCard</a></li>
    
      <li class="section-title">
        <a href="flutter_tindercard/TinderSwapCard-class.html#instance-properties">Properties</a>
      </li>
      <li><a href="flutter_tindercard/TinderSwapCard/swipeCompleteCallback.html">swipeCompleteCallback</a></li>
      <li><a href="flutter_tindercard/TinderSwapCard/swipeUpdateCallback.html">swipeUpdateCallback</a></li>
      <li class="inherited"><a href="flutter_tindercard/TinderSwapCard/hashCode.html">hashCode</a></li>
      <li class="inherited"><a href="flutter_tindercard/TinderSwapCard/key.html">key</a></li>
      <li class="inherited"><a href="flutter_tindercard/TinderSwapCard/runtimeType.html">runtimeType</a></li>
    
      <li class="section-title"><a href="flutter_tindercard/TinderSwapCard-class.html#instance-methods">Methods</a></li>
      <li><a href="flutter_tindercard/TinderSwapCard/createState.html">createState</a></li>
      <li class="inherited"><a href="flutter_tindercard/TinderSwapCard/createElement.html">createElement</a></li>
      <li class="inherited"><a href="flutter_tindercard/TinderSwapCard/debugDescribeChildren.html">debugDescribeChildren</a></li>
      <li class="inherited"><a href="flutter_tindercard/TinderSwapCard/debugFillProperties.html">debugFillProperties</a></li>
      <li class="inherited"><a href="flutter_tindercard/TinderSwapCard/noSuchMethod.html">noSuchMethod</a></li>
      <li class="inherited"><a href="flutter_tindercard/TinderSwapCard/toDiagnosticsNode.html">toDiagnosticsNode</a></li>
      <li class="inherited"><a href="flutter_tindercard/TinderSwapCard/toString.html">toString</a></li>
      <li class="inherited"><a href="flutter_tindercard/TinderSwapCard/toStringDeep.html">toStringDeep</a></li>
      <li class="inherited"><a href="flutter_tindercard/TinderSwapCard/toStringShallow.html">toStringShallow</a></li>
      <li class="inherited"><a href="flutter_tindercard/TinderSwapCard/toStringShort.html">toStringShort</a></li>
    
      <li class="section-title inherited"><a href="flutter_tindercard/TinderSwapCard-class.html#operators">Operators</a></li>
      <li class="inherited"><a href="flutter_tindercard/TinderSwapCard/operator_equals.html">operator ==</a></li>
    
    
    
    </ol>
  </div><!--/.sidebar-offcanvas-left-->

  <div class="col-xs-12 col-sm-9 col-md-8 main-content">
    <h1>TinderSwapCard constructor</h1>

    <section class="multi-line-signature">
      
      <span class="name ">TinderSwapCard</span>(<wbr>{<span class="parameter" id="-param-cardBuilder"><span>@required</span> <span class="type-annotation"><a href="flutter_tindercard/CardBuilder.html">CardBuilder</a></span> <span class="parameter-name">cardBuilder</span>, </span> <span class="parameter" id="-param-totalNum"><span>@required</span> <span class="type-annotation">int</span> <span class="parameter-name">totalNum</span>, </span> <span class="parameter" id="-param-orientation"><span class="type-annotation"><a href="flutter_tindercard/AmassOrientation-class.html">AmassOrientation</a></span> <span class="parameter-name">orientation</span>: <span class="default-value">AmassOrientation.BOTTOM</span>, </span> <span class="parameter" id="-param-stackNum"><span class="type-annotation">int</span> <span class="parameter-name">stackNum</span>: <span class="default-value">3</span>, </span> <span class="parameter" id="-param-maxWidth"><span class="type-annotation">double</span> <span class="parameter-name">maxWidth</span>, </span> <span class="parameter" id="-param-maxHeight"><span class="type-annotation">double</span> <span class="parameter-name">maxHeight</span>, </span> <span class="parameter" id="-param-minWidth"><span class="type-annotation">double</span> <span class="parameter-name">minWidth</span>, </span> <span class="parameter" id="-param-minHeight"><span class="type-annotation">double</span> <span class="parameter-name">minHeight</span>, </span> <span class="parameter" id="-param-swipeCompleteCallback"><span class="type-annotation"><a href="flutter_tindercard/CardSwipeCompleteCallback.html">CardSwipeCompleteCallback</a></span> <span class="parameter-name">swipeCompleteCallback</span>, </span> <span class="parameter" id="-param-swipeUpdateCallback"><span class="type-annotation"><a href="flutter_tindercard/CardDragUpdateCallback.html">CardDragUpdateCallback</a></span> <span class="parameter-name">swipeUpdateCallback</span></span> })
    </section>

    <section class="desc markdown">
      <p>Constructor requires Card Widget Builder <code>cardBuilder</code> &amp; your card count <code>totalNum</code>
, option includes: stack orientation <code>orientation</code>, number of card display in same time <code>stackNum</code>
, and size control params;</p>
    </section>
    
    <section class="summary source-code" id="source">
      <h2><span>Implementation</span> </h2>
      <pre class="language-dart"><code class="language-dart">TinderSwapCard(
    {@required CardBuilder cardBuilder,
    @required int totalNum,
    AmassOrientation orientation = AmassOrientation.BOTTOM,
    int stackNum = 3,
    double maxWidth,
    double maxHeight,
    double minWidth,
    double minHeight,
    this.swipeCompleteCallback,
    this.swipeUpdateCallback})
    : this._cardBuilder = cardBuilder,
      this._totalNum = totalNum,
      assert(stackNum &gt; 1),
      this._stackNum = stackNum,
      assert(maxWidth &gt; minWidth &amp;&amp; maxHeight &gt; minHeight)
&#47;&#47;        this._maxWidth = maxWidth,
&#47;&#47;        this._minWidth = minWidth,
&#47;&#47;        this._maxHeight = maxHeight,
&#47;&#47;        this._minHeight = minHeight
{
  double widthGap = maxWidth - minWidth;
  double heightGap = maxHeight - minHeight;

  _cardAligns = new List();
  _cardSizes = new List();

  for (int i = 0; i &lt; _stackNum; i++) {
    _cardSizes.add(new Size(minWidth + (widthGap &#47; _stackNum) * i,
        minHeight + (heightGap &#47; _stackNum) * i));

    switch (orientation) {
      case AmassOrientation.BOTTOM:
        _cardAligns.add(
            new Alignment(0.0, (0.5 &#47; (_stackNum - 1)) * (stackNum - i)));
        break;
      case AmassOrientation.TOP:
        _cardAligns.add(
            new Alignment(0.0, (-0.5 &#47; (_stackNum - 1)) * (stackNum - i)));
        break;
      case AmassOrientation.LEFT:
        _cardAligns.add(
            new Alignment((-0.5 &#47; (_stackNum - 1)) * (stackNum - i), 0.0));
        break;
      case AmassOrientation.RIGHT:
        _cardAligns.add(
            new Alignment((0.5 &#47; (_stackNum - 1)) * (stackNum - i), 0.0));
        break;
    }
  }
}</code></pre>
    </section>

  </div> <!-- /.main-content -->

  <div class="col-xs-6 col-sm-6 col-md-2 sidebar sidebar-offcanvas-right">
  </div><!--/.sidebar-offcanvas-->

</main>

<footer>
  <span class="no-break">
    flutter_tindercard 0.1.2
  </span>

</footer>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="static-assets/typeahead.bundle.min.js"></script>
<script src="static-assets/highlight.pack.js"></script>
<script src="static-assets/URI.js"></script>
<script src="static-assets/script.js"></script>


</body>

</html>
